using System;
using System.Collections.Generic;
using System.Text;

namespace SharpMud.MudLib.Common.Resourcing
{
    /// <summary>
    /// Indicates that all instances of the implementing class cam be described relationally
    /// and hierarchically as children of another object in the mud
    /// </summary>
    /// <remarks>
    /// Essential because Guids may be fast, but to indicate highly dynamic objects it is
    /// neccesary to be able to locate something that is identified in a human readable form
    /// </remarks>
    public interface IHasInstanceUri
    {
        IUriIdentifiedResourceHost Host { get;}
        Uri                        ID      { get;}
    }

    /// <summary>
    /// Indicates that an object is the hierarchical parent of one or more children objects
    /// </summary>
    public interface IUriIdentifiedResourceHost
    {
        Uri     BaseUri { get;}
        bool    IsDefined(Uri resourceIndicator);
        object  GetResource(Uri resourceIndicator);
    }

    /// <summary>
    /// A generic version of IUriIdentifiedResourceHost that indicates that this object
    /// is the hierarcical parent of one or more specifically-typed children objects
    /// </summary>
    public interface IUriIdentifiedResourceHost<TResource> : IUriIdentifiedResourceHost where TResource : IHasInstanceUri
    {
        new TResource   GetResource(Uri resourceIndicator);
    }
}
